package behavior.strategy.versionThree;

import java.math.BigDecimal;

/**
 * @author huhaiqiang
 * @version V1.0
 * @description 具体算法三
 * @date 2018/12/03 17:43
 */
public class ConcreteStrategyThree extends CashSuperStrategy {

    /**
     * 折扣率
     */
    private BigDecimal moneyRebate;

    /**
     * 初始化时带入折扣率
     */
    ConcreteStrategyThree(String moneyRebate) {
        this.moneyRebate = new BigDecimal(moneyRebate);
    }

    /**
     *
     * @param money 原价
     * @return result 折扣后价格
     */
    @Override
    public BigDecimal acceptCash(BigDecimal money) {
        return money.multiply(moneyRebate);
    }
}
